﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class admin_others_qc : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private string uploadFile()
    {
        return Utils.uploadFile(imageFileUpload, Utils.getCurrentDirectory() + "\\qc\\");
    }
    protected void uploadButton_Click(object sender, EventArgs e)
    {
        string fileName = uploadFile();
        DB db = new DB();
        db.addQualityControl(fileName);
        Response.Redirect("qc.aspx");
    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("deleteImage"))
        {
            DB db = new DB();
            db.deleteQualityControl(Convert.ToInt32(e.CommandArgument));
            Response.Redirect("qc.aspx");
        }
    }
}
